<template>
    <z-table name="adbkw02r" :entitys="entitys" :beforeAdd="beforeAdd">
    </z-table>
</template>

<script>
import configs from './.lowcode/configs';

export default {
    name: 'p-adbkw02r',
    provide: {configs},
    data() {
        return {
            entitys: {
                type: {
                    default: 2,
                    readonly: true
                },
                notice: {
                    type: 'user',
                    multiple: true,
                    tip: "合同负责人自动通知"
                },
                contractId: {
                    tenant: true
                }
            }
        }
    },
    methods: {
        beforeAdd(formData) {
            if (!formData.notice||formData.notice.length == 0) {
                $.fail("请选择通知对象")
            } else if (!formData.contractId) {
                $.fail("请选择合同")
            }else if (!formData.content) {
                $.fail("请输入风险描述")
            } else {
                return formData;
             }
            return false;
        }
    }
}
</script>
